﻿Public Class frmServerProperties

    Private RS As ReportServer = Nothing

    Public WriteOnly Property ReportServer() As ReportServer
        Set(ByVal value As ReportServer)
            RS = value
        End Set
    End Property

    Private Sub frmServerProperties_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        lblServer.Text = RS.URL
        txtServerEdition.Text = RS.ReportServerEdition
        txtServerVersionNumber.Text = RS.ReportServerVersionNumber
        txtTimeOut.Text = RS.TimeOut
        txtUserAgent.Text = RS.UserAgent
        Dim Jobs As RSToolKit.ReportService.Job() = RS.ws.ListJobs()
        For Each Job As RSToolKit.ReportService.Job In Jobs
            Dim dgvRow As New Windows.Forms.DataGridViewRow
            dgvRow.Cells(0).Value = Job.Name
            dgvRow.Cells(1).Value = Job.StartDateTime
            dgvRow.Cells(2).Value = Job.Status
            dgvRow.Cells(3).Value = Job.Type
            dgvJobs.Rows.Add(dgvRow)
        Next
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Me.DialogResult = Windows.Forms.DialogResult.OK
    End Sub

    Private Sub lblServer_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles lblServer.LinkClicked
        Process.Start(RS.URL)
    End Sub
End Class